package one.stand.mapper;


import one.stand.model.essay.TaskCustomerModel;
import one.stand.request.essay.TaskCustomerForm;
import one.stand.request.essay.TaskCustomerQuery;
import one.stand.request.essay.UpdateMyTaskFrom;
import one.stand.response.essay.TaskCustomerResponse;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 获客文章任务-任务相关的task开头方便定位 Mapper 接口
 * </p>
 *
 * @author luoyang
 * @since 2020-05-11
 */
public interface TaskCustomerMapper {

    TaskCustomerModel queryById(int id);

    TaskCustomerResponse queryByIdRes(int id);

    int update(TaskCustomerModel model);

    int deleteById(int id);

    int insert(TaskCustomerModel model);

    List<TaskCustomerModel> queryAll(TaskCustomerQuery query);


    TaskCustomerModel queryByDynamicId(Integer dynamicId);

    TaskCustomerModel queryUserCompany(TaskCustomerForm request);

    /**
     * 查询所有未结束的任务
     * @return
     */
    List<TaskCustomerModel> queryTaskAll(@Param("state") Integer state, @Param("time")Date time);

    /**
     * 更新任务状态
     * @param request
     * @return
     */
    int updateState(UpdateMyTaskFrom request);
}
